from .resnet_fpn import ResNetFPN_8_2
# from .lsnet import LSNetFPN_8_2
from .backbone import RepVGG_8_1_align

def build_backbone(config):
    if config['backbone_type'] == 'ReqVGG':
        if config['resolution'] == (8, 1):
            return RepVGG_8_1_align(config['backbone'])

    elif config['backbone_type'] == 'ResNetFPN':
        if config['resolution'] == (8, 2):
            return ResNetFPN_8_2(config['resnetfpn'])
            # return LSNetFPN_8_2(img_size=480)
        else:
            raise ValueError(f"LOFTR.BACKBONE_TYPE {config['backbone_type']} not supported.")
    else:
        raise ValueError(f"LOFTR.BACKBONE_TYPE {config['backbone_type']} not supported.")
